<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLevelWordsTable extends Migration
{
    protected $tableName = 'level_words';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create($this->tableName, function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedSmallInteger('level')->comment('级别');
            $table->string('en')->comment('英文');
            $table->string('cn')->comment('中文');
            $table->timestamps();

            $table->softDeletes();

        });
        DB::statement("ALTER TABLE `$this->tableName` comment '级别对应单词'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists($this->tableName);
    }
}
